Skip to content

Switch push created repo to ContainerRepository#2366

Merged
gerrod3 merged 12 commits into
pulp:mainfrom
gerrod3:push-no-more
Jun 11, 2026
Merged

Switch push created repo to ContainerRepository#2366
gerrod3 merged 12 commits into
pulp:mainfrom
gerrod3:push-no-more

Conversation

@gerrod3

@gerrod3 gerrod3 commented May 19, 2026

Copy link
Copy Markdown
Contributor

https://redhat.atlassian.net/browse/PULP-1748
Assisted by: cursor composer 2

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@gerrod3 gerrod3 force-pushed the push-no-more branch 2 times, most recently from 6a9693a to ed996a1 Compare May 21, 2026 19:08
Treat registry-pushed container repositories like push repos when signing,
allow legacy push repo fixtures without a distribution, clean up test
distributions, and update RBAC content expectations for repository viewers.

Co-authored-by: Cursor <cursoragent@cursor.com>
gerrod3 and others added 3 commits June 1, 2026 15:37
Match ContainerPushRepository permission checks when scoping content
queries by repository_version on registry-pushed container repositories.

Co-authored-by: Cursor <cursoragent@cursor.com>
Model-level view_containerdistribution must not grant repository_version
filtering on synced container repositories that have a remote.

Co-authored-by: Cursor <cursoragent@cursor.com>
Distribution consumers may only filter content by repository_version on
container repositories that have no remote and are tied to a distribution.

Co-authored-by: Cursor <cursoragent@cursor.com>
gerrod3 and others added 6 commits June 1, 2026 17:09
Exclude push-created container repositories from mirror-scoped tag
access so distribution permissions govern that content instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@gerrod3 gerrod3 marked this pull request as ready for review June 5, 2026 20:11
)
ns_repository_pks = models.ContainerDistribution.objects.filter(
namespace__in=namespaces,
pulp_domain=domain,

@dralley dralley Jun 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completely unrelated to this PR, but it would be nice if we could make have queries automatically detect domain from a context var and filter based on that domain. It's tedious and error prone to have to include the domain in every query. Maybe there's an ORM middleware for that.

Comment thread docs/admin/learn/rbac.md Outdated

#### `docker/podman push`

When pushing an image to Pulp there are three different scenarios a user can find themselves in which determines the permissions that are checked for during the push.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is a bit too indirect and can be made more straightforwards. I would also maybe reverse the order of the scenarios if you're going to talk about scenario 3 first.

Comment thread docs/admin/learn/rbac.md

#### `docker/podman pull`

When pulling an image Pulp will check the `pull` action on the Container Distribution access policy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct to say that all users must have a Pulp user in order to pull content? I was trying to figure out what direction to go in with the pulp_rust plugin, since the normal protocol is that each user is assigned a secret API token which is then used for auth, but strictly speaking auth could probably go through the Pulp user permissions / RBAC system.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the pull action checks to see if the distribution is not private first, if it is "public" then any user, authenticated or not, can pull the image. If the distro is private then the user needs to be logged in as Pulp user.

Comment thread docs/admin/learn/rbac.md
##### Push to a new namespace

Let's start with Scenario 3 which requires the least amount of permissions and only checks the `push` action on the Container Distribution access policy.
If the namespace does not exist, Pulp checks the `create` action on the Namespace access policy. The user needs `container.add_containernamespace`, or the namespace name must match their username. On success, they are granted the Namespace *Owner* role for the new namespace, which in turn grants them permission to create the distribution for the new image.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user needs container.add_containernamespace, or the namespace name must match their username.

Does this mean that users could create a namespace that matches a different username?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes if they have the Namespace creator role or are admin.

@gerrod3 gerrod3 merged commit 1b76e51 into pulp:main Jun 11, 2026
13 of 14 checks passed
@gerrod3 gerrod3 deleted the push-no-more branch June 11, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants